package StudyCode.summary.myfile;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class OneSeparator {
	public static void main(String[] args) {
		System.out.println(concat("E:", "Copy/1/2/3", '/'));
	}

	private static String concat(String path1, String path2, char sep) {

		StringBuilder b = new StringBuilder();
		if (path1.charAt(path1.length() - 1) == sep) {
			b.append(path1, 0, path1.length() - 1);
		} else {
			b.append(path1);
		}
		b.append(sep);
		if (path2.charAt(0) == sep) {
			b.append(path2, 1, path2.length());
		} else {
			b.append(path2);
		}
		return b.toString();
	}
}
